<template>
  <Child ref="childRef"></Child>

  <button @click="fn">点击显示</button>
</template>
<script setup>
import Child from './components/ref操作子组件.vue'
import { ref } from 'vue'

const childRef = ref(null)

const fn = () => {
  console.log(childRef.value.childValue)

  childRef.value.childMehod()
}
</script>
<style lang="less"></style>
